<?php

!defined('SYSTEM_INCLUDED') && exit('Access Denied');

Class BaseController{
	
	public $view;
	
	public $model = array();
	
	public function __Construct(){
        $this->setVendor();
	}
	

	//加载模版引擎
	public function setVendor(){
        $VendorName = Config::get('TPL_VENDOR_NAME');
		switch ($VendorName){
			case "NotGoodTPL":
		        SysBase::import('System.Vendor.NotGoodTPL.NotGoodTPL');
			    $this->view=SysBase::getInstance('NotGoodTPL');
			    break;
			default:
			    throw new CommonException ("Template Vendor/Engine is Not found!");
		}		
	}
	
	
	//加载一个模型，并将其实例化
	public function createModel($modelName){
		$result = SysBase::import("App.Model.{$modelName}");
		if(false == $result){
			throw new CommonException ("Model:{$controller} doesn't exist!");
		}
		return new $modelName();

	}
	
	
}